package com.chianghao.nio.core.handle.http;

/**
 * @author ChiangHao
 */
public class HttpRoute {

    private HttpMethod method;
    private String url;
    private IHttpHandle handle;

    public HttpMethod getMethod() {
        return method;
    }

    public void setMethod(HttpMethod method) {
        this.method = method;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public IHttpHandle getHandle() {
        return handle;
    }

    public void setHandle(IHttpHandle handle) {
        this.handle = handle;
    }

    public HttpRoute(HttpMethod method, String url, IHttpHandle handle){
        this.method = method;
        this.url = url;
        this.handle = handle;
    }


    public void handle(HttpRequest request,HttpResponse response){
        this.handle.handle(request,response);
    }

}
